const workerScript = `
self.onmessage = function(event) {
    if (event.data === 'start') {
        self.timer = setInterval(function() {
            self.postMessage('heartbeat');
        }, 10000); // 十秒
    } else if (event.data === 'stop') {
        console.log('stop worker heart.');
        clearInterval(self.timer);
    }
};
`;

export default workerScript;
